{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Pipeline NotebookNode\n",
    "This notebook will represent a single node of a pipeline.  It will be completely driven via the following environment variables configured on the node properties dialog of the pipeline:\n",
    "- `NODE_FILENAME`: (Required) The filename associated with the node.  The extension is used to validate that the node matches the associated file.  The basename portion represents the node name - and is used in producing the output files.\n",
    "- `INPUT_FILENAMES`: (Optional) A SEMI-COLON-separated list of filenames.  Each entry can include a _relative_ path as a prefix to the filename.  Each file is expected to exist and contain content.  The content will be printed and should appear in the out of a cell.\n",
    "- `OUTPUT_FILENAMES`: (Optional) A SEMI-COLON-separated list of filenames.  Each entry can include a _relative_ path as a prefix to the filename.  Each file is NOT expected to exist, but will be created as a function of the notebook's execution."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip3 install --upgrade pygithub"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from github import Github"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "from node_util import NotebookNode\n",
    "# These getenv calls are here to help seed the environment variables \n",
    "# dialog in the node properties of the pipeline editor\n",
    "os.getenv(\"NODE_FILENAME\")\n",
    "os.getenv(\"INPUT_FILENAMES\")\n",
    "os.getenv(\"OUTPUT_FILENAMES\")\n",
    "# Execute the node\n",
    "NotebookNode().run()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
